data{
    int<lower=1> N;
    int T[N];
    int VT[N];
    int AVT[N];
}
parameters{
    real a;
    real bVT;
    real bAVT;
}
model{
    vector[N] lp;
    bAVT ~ normal( 0 , 10 );
    bVT ~ normal( 0 , 10 );
    a ~ normal( 0 , 10 );
    for ( i in 1:N ) {
        lp[i] = a + bVT * VT[i] + bAVT * AVT[i];
    }
    T ~ binomial_logit( 1 , lp );
}
generated quantities{
    vector[N] lp;
    real dev;
    dev = 0;
    for ( i in 1:N ) {
        lp[i] = a + bVT * VT[i] + bAVT * AVT[i];
    }
    dev = dev + (-2)*binomial_logit_lpmf( T | 1 , lp );
}
